package clei.sample

import io.reactivex.Flowable
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET

/**
 *  create by chenglei at 2018/10/25
 */


interface LanguageService {
    @GET("paging")
    fun getLanguage(): Flowable<MyResponse>

    @GET("paging")
    fun getLaungageSync():Call<MyResponse>
}


object LanguageApi {
    private var retrofit:Retrofit = Retrofit.Builder()
//            .baseUrl("http://192.168.101.31:8080/")
            .baseUrl("http://172.16.241.134:8080/")
            .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create())
            .build()

    fun getLanguageRetrofit() = retrofit.create(LanguageService::class.java)
}